home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / rect.elc < prev    next >
Emacs Compiled Lisp  |  1995-08-29  |  5.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was processed as: Emacs Compiled Lisp (other/emacsCompiledLisp).
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert Emacs Compiled Lisp (other/emacsCompiledLisp) magic Unsupported
1% dexvert Combustion 2 Particle Library (other/combustion2ParticleLibrary) ext Unsupported
100% file Emacs/XEmacs v19 byte-compiled Lisp data default
99% file data default
100% TrID Emacs/XEmacs byte-compiled Lisp (generic) default
100% xdgMime text/x-emacs-lisp default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 45 4c 43 13 00 00 00 | 0a 3b 3b 3b 20 63 6f 6d |;ELC....|.;;; com|
|00000010| 70 69 6c 65 64 20 62 79 | 20 63 74 68 6f 6d 70 40 |piled by| cthomp@|
|00000020| 77 69 6c 6c 6f 77 2e 63 | 73 2e 75 69 75 63 2e 65 |willow.c|s.uiuc.e|
|00000030| 64 75 20 6f 6e 20 54 75 | 65 20 41 75 67 20 32 39 |du on Tu|e Aug 29|
|00000040| 20 31 34 3a 32 31 3a 35 | 33 20 31 39 39 35 0a 3b | 14:21:5|3 1995.;|
|00000050| 3b 3b 20 66 72 6f 6d 20 | 66 69 6c 65 20 2f 78 65 |;; from |file /xe|
|00000060| 6d 61 63 73 2f 78 65 6d | 61 63 73 2d 31 39 2e 31 |macs/xem|acs-19.1|
|00000070| 33 2d 72 65 6c 65 61 73 | 65 2f 65 64 69 74 6f 72 |3-releas|e/editor|
|00000080| 2f 6c 69 73 70 2f 70 72 | 69 6d 2f 72 65 63 74 2e |/lisp/pr|im/rect.|
|00000090| 65 6c 0a 3b 3b 3b 20 65 | 6d 61 63 73 20 76 65 72 |el.;;; e|macs ver|
|000000a0| 73 69 6f 6e 20 31 39 2e | 31 33 20 58 45 6d 61 63 |sion 19.|13 XEmac|
|000000b0| 73 20 4c 75 63 69 64 2e | 0a 3b 3b 3b 20 62 79 74 |s Lucid.|.;;; byt|
|000000c0| 65 63 6f 6d 70 20 76 65 | 72 73 69 6f 6e 20 32 2e |ecomp ve|rsion 2.|
|000000d0| 32 35 3b 20 31 2d 53 65 | 70 2d 39 34 2e 0a 3b 3b |25; 1-Se|p-94..;;|
|000000e0| 3b 20 6f 70 74 69 6d 69 | 7a 61 74 69 6f 6e 20 69 |; optimi|zation i|
|000000f0| 73 20 6f 6e 2e 0a 3b 3b | 3b 20 74 68 69 73 20 66 |s on..;;|; this f|
|00000100| 69 6c 65 20 75 73 65 73 | 20 6f 70 63 6f 64 65 73 |ile uses| opcodes|
|00000110| 20 77 68 69 63 68 20 64 | 6f 20 6e 6f 74 20 65 78 | which d|o not ex|
|00000120| 69 73 74 20 69 6e 20 45 | 6d 61 63 73 20 31 38 2e |ist in E|macs 18.|
|00000130| 0a 0a 28 69 66 20 28 61 | 6e 64 20 28 62 6f 75 6e |..(if (a|nd (boun|
|00000140| 64 70 20 27 65 6d 61 63 | 73 2d 76 65 72 73 69 6f |dp 'emac|s-versio|
|00000150| 6e 29 0a 09 20 28 6f 72 | 20 28 61 6e 64 20 28 62 |n).. (or| (and (b|
|00000160| 6f 75 6e 64 70 20 27 65 | 70 6f 63 68 3a 3a 76 65 |oundp 'e|poch::ve|
|00000170| 72 73 69 6f 6e 29 20 65 | 70 6f 63 68 3a 3a 76 65 |rsion) e|poch::ve|
|00000180| 72 73 69 6f 6e 29 0a 09 | 20 20 20 20 20 28 73 74 |rsion)..| (st|
|00000190| 72 69 6e 67 2d 6c 65 73 | 73 70 20 65 6d 61 63 73 |ring-les|sp emacs|
|000001a0| 2d 76 65 72 73 69 6f 6e | 20 22 31 39 22 29 29 29 |-version| "19")))|
|000001b0| 0a 20 20 20 20 28 65 72 | 72 6f 72 20 22 54 68 69 |. (er|ror "Thi|
|000001c0| 73 20 66 69 6c 65 20 77 | 61 73 20 63 6f 6d 70 69 |s file w|as compi|
|000001d0| 6c 65 64 20 66 6f 72 20 | 45 6d 61 63 73 20 31 39 |led for |Emacs 19|
|000001e0| 2e 22 29 29 0a 0a 28 66 | 73 65 74 20 27 6f 70 65 |."))..(f|set 'ope|
|000001f0| 72 61 74 65 2d 6f 6e 2d | 72 65 63 74 61 6e 67 6c |rate-on-|rectangl|
|00000200| 65 20 23 5b 28 66 75 6e | 63 74 69 6f 6e 20 73 74 |e #[(fun|ction st|
|00000210| 61 72 74 20 65 6e 64 20 | 63 6f 65 72 63 65 2d 74 |art end |coerce-t|
|00000220| 61 62 73 20 26 72 65 73 | 74 20 65 78 74 72 61 2d |abs &res|t extra-|
|00000230| 61 72 67 73 29 20 22 c0 | 89 89 89 19 1a 1b 1c 8a |args) ".|........|
|00000240| 0d 62 88 69 14 c6 79 88 | 60 13 29 8a 0e 07 62 88 |.b.i..y.|`.)...b.|
|00000250| 69 12 c8 79 88 c9 20 11 | 29 5c 6e 0c 57 ab 89 0c |i..y.. .|)\n.W...|
|00000260| 1e 5c 6e 5c 6e 14 0e 5c | 6e 12 29 8a 0b 62 88 60 |.\n\n..\|n.)..b.`|
|00000270| 09 57 ab c5 c0 89 89 1e | 0b 1e 0c 1e 0d ce 0c 0e |.W......|........|
|00000280| 0f 5c 22 88 69 0c 5a 16 | 0c 60 16 0d ce 5c 6e 0e |.\".i.Z.|.`...\n.|
|00000290| 0f 5c 22 88 5c 6e 69 5a | 16 0b 0e 0c c6 57 ab 8a |.\".\niZ|.....W..|
|000002a0| 0e 0b 0e 0c 5c 5c 16 0b | c6 16 0c d0 0e 11 0e 0d |....\\..|........|
|000002b0| 0e 0c 0e 0b 0e 12 25 88 | 2b c8 79 88 aa 36 29 5c |......%.|+.y..6)\|
|000002c0| 6e 0c 5a 2c 87 22 20 5b | 6e 69 6c 20 65 6e 64 6c |n.Z,." [|nil endl|
|000002d0| 69 6e 65 70 6f 73 20 65 | 6e 64 63 6f 6c 20 73 74 |inepos e|ndcol st|
|000002e0| 61 72 74 6c 69 6e 65 70 | 6f 73 20 73 74 61 72 74 |artlinep|os start|
|000002f0| 63 6f 6c 20 73 74 61 72 | 74 20 30 20 65 6e 64 20 |col star|t 0 end |
|00000300| 31 20 70 6f 69 6e 74 2d | 6d 61 72 6b 65 72 20 74 |1 point-|marker t|
|00000310| 65 6d 20 65 6e 64 65 78 | 74 72 61 20 62 65 67 65 |em endex|tra bege|
|00000320| 78 74 72 61 20 73 74 61 | 72 74 70 6f 73 20 6d 6f |xtra sta|rtpos mo|
|00000330| 76 65 2d 74 6f 2d 63 6f | 6c 75 6d 6e 20 63 6f 65 |ve-to-co|lumn coe|
|00000340| 72 63 65 2d 74 61 62 73 | 20 61 70 70 6c 79 20 66 |rce-tabs| apply f|
|00000350| 75 6e 63 74 69 6f 6e 20 | 65 78 74 72 61 2d 61 72 |unction |extra-ar|
|00000360| 67 73 5d 20 36 20 22 5c | 0a 43 61 6c 6c 20 46 55 |gs] 6 "\|.Call FU|
|00000370| 4e 43 54 49 4f 4e 20 66 | 6f 72 20 65 61 63 68 20 |NCTION f|or each |
|00000380| 6c 69 6e 65 20 6f 66 20 | 72 65 63 74 61 6e 67 6c |line of |rectangl|
|00000390| 65 20 77 69 74 68 20 63 | 6f 72 6e 65 72 73 20 61 |e with c|orners a|
|000003a0| 74 20 53 54 41 52 54 2c | 20 45 4e 44 2e 0a 49 66 |t START,| END..If|
|000003b0| 20 43 4f 45 52 43 45 2d | 54 41 42 53 20 69 73 20 | COERCE-|TABS is |
|000003c0| 6e 6f 6e 2d 6e 69 6c 2c | 20 63 6f 6e 76 65 72 74 |non-nil,| convert|
|000003d0| 20 6d 75 6c 74 69 2d 63 | 6f 6c 75 6d 6e 20 63 68 | multi-c|olumn ch|
|000003e0| 61 72 61 63 74 65 72 73 | 0a 74 68 61 74 20 73 70 |aracters|.that sp|
|000003f0| 61 6e 20 74 68 65 20 73 | 74 61 72 74 69 6e 67 20 |an the s|tarting |
|00000400| 6f 72 20 65 6e 64 69 6e | 67 20 63 6f 6c 75 6d 6e |or endin|g column|
|00000410| 73 20 6f 6e 20 61 6e 79 | 20 6c 69 6e 65 0a 74 6f |s on any| line.to|
|00000420| 20 6d 75 6c 74 69 70 6c | 65 20 73 70 61 63 65 73 | multipl|e spaces|
|00000430| 20 62 65 66 6f 72 65 20 | 63 61 6c 6c 69 6e 67 20 | before |calling |
|00000440| 46 55 4e 43 54 49 4f 4e | 2e 0a 46 55 4e 43 54 49 |FUNCTION|..FUNCTI|
|00000450| 4f 4e 20 69 73 20 63 61 | 6c 6c 65 64 20 77 69 74 |ON is ca|lled wit|
|00000460| 68 20 74 68 72 65 65 20 | 61 72 67 75 6d 65 6e 74 |h three |argument|
|00000470| 73 3a 0a 20 70 6f 73 69 | 74 69 6f 6e 20 6f 66 20 |s:. posi|tion of |
|00000480| 73 74 61 72 74 20 6f 66 | 20 73 65 67 6d 65 6e 74 |start of| segment|
|00000490| 20 6f 66 20 74 68 69 73 | 20 6c 69 6e 65 20 77 69 | of this| line wi|
|000004a0| 74 68 69 6e 20 74 68 65 | 20 72 65 63 74 61 6e 67 |thin the| rectang|
|000004b0| 6c 65 2c 0a 20 6e 75 6d | 62 65 72 20 6f 66 20 63 |le,. num|ber of c|
|000004c0| 6f 6c 75 6d 6e 73 20 74 | 68 61 74 20 62 65 6c 6f |olumns t|hat belo|
|000004d0| 6e 67 20 74 6f 20 72 65 | 63 74 61 6e 67 6c 65 20 |ng to re|ctangle |
|000004e0| 62 75 74 20 61 72 65 20 | 62 65 66 6f 72 65 20 74 |but are |before t|
|000004f0| 68 61 74 20 70 6f 73 69 | 74 69 6f 6e 2c 0a 20 6e |hat posi|tion,. n|
|00000500| 75 6d 62 65 72 20 6f 66 | 20 63 6f 6c 75 6d 6e 73 |umber of| columns|
|00000510| 20 74 68 61 74 20 62 65 | 6c 6f 6e 67 20 74 6f 20 | that be|long to |
|00000520| 72 65 63 74 61 6e 67 6c | 65 20 62 75 74 20 61 72 |rectangl|e but ar|
|00000530| 65 20 61 66 74 65 72 20 | 70 6f 69 6e 74 2e 0a 50 |e after |point..P|
|00000540| 6f 69 6e 74 20 69 73 20 | 61 74 20 74 68 65 20 65 |oint is |at the e|
|00000550| 6e 64 20 6f 66 20 74 68 | 65 20 73 65 67 6d 65 6e |nd of th|e segmen|
|00000560| 74 20 6f 66 20 74 68 69 | 73 20 6c 69 6e 65 20 77 |t of thi|s line w|
|00000570| 69 74 68 69 6e 20 74 68 | 65 20 72 65 63 74 61 6e |ithin th|e rectan|
|00000580| 67 6c 65 2e 22 5d 29 0a | 28 62 79 74 65 2d 63 6f |gle."]).|(byte-co|
|00000590| 64 65 20 22 c0 c1 4d 88 | c2 c3 4d 88 c4 c5 4d 88 |de "..M.|..M...M.|
|000005a0| c6 c7 21 16 08 c9 ca 4d | 87 22 20 5b 64 65 6c 65 |..!....M|." [dele|
|000005b0| 74 65 2d 72 65 63 74 61 | 6e 67 6c 65 2d 6c 69 6e |te-recta|ngle-lin|
|000005c0| 65 20 23 5b 28 73 74 61 | 72 74 64 65 6c 70 6f 73 |e #[(sta|rtdelpos|
|000005d0| 20 69 67 6e 6f 72 65 20 | 69 67 6e 6f 72 65 29 20 | ignore |ignore) |
|000005e0| 22 08 60 7c 87 22 20 5b | 73 74 61 72 74 64 65 6c |".`|." [|startdel|
|000005f0| 70 6f 73 5d 20 32 5d 20 | 64 65 6c 65 74 65 2d 65 |pos] 2] |delete-e|
|00000600| 78 74 72 61 63 74 2d 72 | 65 63 74 61 6e 67 6c 65 |xtract-r|ectangle|
|00000610| 2d 6c 69 6e 65 20 23 5b | 28 73 74 61 72 74 64 65 |-line #[|(startde|
|00000620| 6c 70 6f 73 20 62 65 67 | 65 78 74 72 61 20 65 6e |lpos beg|extra en|
|00000630| 64 65 78 74 72 61 20 6c | 69 6e 65 73 29 20 22 8a |dextra l|ines) ".|
|00000640| c0 09 5c 6e 0b 0c 24 88 | 29 09 60 7c 87 22 20 5b |..\n..$.|).`|." [|
|00000650| 65 78 74 72 61 63 74 2d | 72 65 63 74 61 6e 67 6c |extract-|rectangl|
|00000660| 65 2d 6c 69 6e 65 20 73 | 74 61 72 74 64 65 6c 70 |e-line s|tartdelp|
|00000670| 6f 73 20 62 65 67 65 78 | 74 72 61 20 65 6e 64 65 |os begex|tra ende|
|00000680| 78 74 72 61 20 6c 69 6e | 65 73 5d 20 35 5d 20 65 |xtra lin|es] 5] e|
|00000690| 78 74 72 61 63 74 2d 72 | 65 63 74 61 6e 67 6c 65 |xtract-r|ectangle|
|000006a0| 2d 6c 69 6e 65 20 23 5b | 28 73 74 61 72 74 64 65 |-line #[|(startde|
|000006b0| 6c 70 6f 73 20 62 65 67 | 65 78 74 72 61 20 65 6e |lpos beg|extra en|
|000006c0| 64 65 78 74 72 61 20 6c | 69 6e 65 73 29 20 22 08 |dextra l|ines) ".|
|000006d0| 60 7b 60 19 1a 08 62 88 | c3 c4 09 c5 23 ab a4 69 |`{`...b.|....#..i|
|000006e0| 8a c6 75 88 69 29 5a 1e | 07 5c 6e c8 60 09 5a c9 |..u.i)Z.|.\n.`.Z.|
|000006f0| 5a 4f ca 0e 07 21 5c 6e | 89 47 60 09 5a 5c 5c cb |ZO...!\n|.G`.Z\\.|
|00000700| 4f 51 12 29 aa 55 0e 0c | c8 56 ac 86 0e 0d c8 56 |OQ.).U..|.V.....V|
|00000710| ab 8b ca 0e 0c 21 5c 6e | ca 0e 0d 21 51 12 0e 0e |.....!\n|...!Q...|
|00000720| 5c 6e 0e 0e 41 42 a1 2a | 87 22 20 5b 73 74 61 72 |\n..AB.*|." [star|
|00000730| 74 64 65 6c 70 6f 73 20 | 65 6e 64 20 6c 69 6e 65 |tdelpos |end line|
|00000740| 20 73 65 61 72 63 68 2d | 66 6f 72 77 61 72 64 20 | search-|forward |
|00000750| 22 09 22 20 74 20 2d 31 | 20 77 69 64 74 68 20 30 |"." t -1| width 0|
|00000760| 20 31 20 73 70 61 63 65 | 73 2d 73 74 72 69 6e 67 | 1 space|s-string|
|00000770| 20 6e 69 6c 20 62 65 67 | 65 78 74 72 61 20 65 6e | nil beg|extra en|
|00000780| 64 65 78 74 72 61 20 6c | 69 6e 65 73 5d 20 36 5d |dextra l|ines] 6]|
|00000790| 20 70 75 72 65 63 6f 70 | 79 20 5b 22 22 20 22 20 | purecop|y ["" " |
|000007a0| 22 20 22 20 20 22 20 22 | 20 20 20 22 20 22 20 20 |" " " "| " " |
|000007b0| 20 20 22 20 22 20 20 20 | 20 20 22 20 22 20 20 20 | " " | " " |
|000007c0| 20 20 20 22 20 22 20 20 | 20 20 20 20 20 22 20 22 | " " | " "|
|000007d0| 20 20 20 20 20 20 20 20 | 22 5d 20 73 70 61 63 65 | |"] space|
|000007e0| 73 2d 73 74 72 69 6e 67 | 73 20 73 70 61 63 65 73 |s-string|s spaces|
|000007f0| 2d 73 74 72 69 6e 67 20 | 23 5b 28 6e 29 20 22 08 |-string |#[(n) ".|
|00000800| c1 58 ab 84 5c 6e 08 48 | 87 c3 1c 08 c1 56 ab 8b |.X..\n.H|.....V..|
|00000810| c5 0c 50 14 08 c1 5a 89 | 10 aa 71 0c 5c 6e 08 48 |..P...Z.|..q.\n.H|
|00000820| 50 29 87 22 20 5b 6e 20 | 38 20 73 70 61 63 65 73 |P)." [n |8 spaces|
|00000830| 2d 73 74 72 69 6e 67 73 | 20 22 22 20 76 61 6c 20 |-strings| "" val |
|00000840| 22 20 20 20 20 20 20 20 | 20 22 5d 20 34 5d 5d 20 |" | "] 4]] |
|00000850| 32 29 0a 28 66 73 65 74 | 20 27 64 65 6c 65 74 65 |2).(fset| 'delete|
|00000860| 2d 72 65 63 74 61 6e 67 | 6c 65 20 23 5b 28 73 74 |-rectang|le #[(st|
|00000870| 61 72 74 20 65 6e 64 29 | 20 22 c0 c1 5c 6e 0b c4 |art end)| "..\n..|
|00000880| 24 87 22 20 5b 6f 70 65 | 72 61 74 65 2d 6f 6e 2d |$." [ope|rate-on-|
|00000890| 72 65 63 74 61 6e 67 6c | 65 20 64 65 6c 65 74 65 |rectangl|e delete|
|000008a0| 2d 72 65 63 74 61 6e 67 | 6c 65 2d 6c 69 6e 65 20 |-rectang|le-line |
|000008b0| 73 74 61 72 74 20 65 6e | 64 20 74 5d 20 35 20 22 |start en|d t] 5 "|
|000008c0| 5c 0a 44 65 6c 65 74 65 | 20 28 64 6f 6e 27 74 20 |\.Delete| (don't |
|000008d0| 73 61 76 65 29 20 74 65 | 78 74 20 69 6e 20 72 65 |save) te|xt in re|
|000008e0| 63 74 61 6e 67 6c 65 20 | 77 69 74 68 20 70 6f 69 |ctangle |with poi|
|000008f0| 6e 74 20 61 6e 64 20 6d | 61 72 6b 20 61 73 20 63 |nt and m|ark as c|
|00000900| 6f 72 6e 65 72 73 2e 0a | 54 68 65 20 73 61 6d 65 |orners..|The same|
|00000910| 20 72 61 6e 67 65 20 6f | 66 20 63 6f 6c 75 6d 6e | range o|f column|
|00000920| 73 20 69 73 20 64 65 6c | 65 74 65 64 20 69 6e 20 |s is del|eted in |
|00000930| 65 61 63 68 20 6c 69 6e | 65 0a 73 74 61 72 74 69 |each lin|e.starti|
|00000940| 6e 67 20 77 69 74 68 20 | 74 68 65 20 6c 69 6e 65 |ng with |the line|
|00000950| 20 77 68 65 72 65 20 74 | 68 65 20 72 65 67 69 6f | where t|he regio|
|00000960| 6e 20 62 65 67 69 6e 73 | 0a 61 6e 64 20 65 6e 64 |n begins|.and end|
|00000970| 69 6e 67 20 77 69 74 68 | 20 74 68 65 20 6c 69 6e |ing with| the lin|
|00000980| 65 20 77 68 65 72 65 20 | 74 68 65 20 72 65 67 69 |e where |the regi|
|00000990| 6f 6e 20 65 6e 64 73 2e | 22 20 22 72 22 5d 29 0a |on ends.|" "r"]).|
|000009a0| 28 66 73 65 74 20 27 64 | 65 6c 65 74 65 2d 65 78 |(fset 'd|elete-ex|
|000009b0| 74 72 61 63 74 2d 72 65 | 63 74 61 6e 67 6c 65 20 |tract-re|ctangle |
|000009c0| 23 5b 28 73 74 61 72 74 | 20 65 6e 64 29 20 22 c0 |#[(start| end) ".|
|000009d0| 43 19 c2 c3 0c 0d c6 09 | 25 88 09 41 9f 29 87 22 |C.......|%..A.)."|
|000009e0| 20 5b 6e 69 6c 20 6c 69 | 6e 65 73 20 6f 70 65 72 | [nil li|nes oper|
|000009f0| 61 74 65 2d 6f 6e 2d 72 | 65 63 74 61 6e 67 6c 65 |ate-on-r|ectangle|
|00000a00| 20 64 65 6c 65 74 65 2d | 65 78 74 72 61 63 74 2d | delete-|extract-|
|00000a10| 72 65 63 74 61 6e 67 6c | 65 2d 6c 69 6e 65 20 73 |rectangl|e-line s|
|00000a20| 74 61 72 74 20 65 6e 64 | 20 74 5d 20 36 20 22 5c |tart end| t] 6 "\|
|00000a30| 0a 44 65 6c 65 74 65 20 | 63 6f 6e 74 65 6e 74 73 |.Delete |contents|
|00000a40| 20 6f 66 20 72 65 63 74 | 61 6e 67 6c 65 20 61 6e | of rect|angle an|
|00000a50| 64 20 72 65 74 75 72 6e | 20 69 74 20 61 73 20 61 |d return| it as a|
|00000a60| 20 6c 69 73 74 20 6f 66 | 20 73 74 72 69 6e 67 73 | list of| strings|
|00000a70| 2e 0a 41 72 67 75 6d 65 | 6e 74 73 20 53 54 41 52 |..Argume|nts STAR|
|00000a80| 54 20 61 6e 64 20 45 4e | 44 20 61 72 65 20 74 68 |T and EN|D are th|
|00000a90| 65 20 63 6f 72 6e 65 72 | 73 20 6f 66 20 74 68 65 |e corner|s of the|
|00000aa0| 20 72 65 63 74 61 6e 67 | 6c 65 2e 0a 54 68 65 20 | rectang|le..The |
|00000ab0| 76 61 6c 75 65 20 69 73 | 20 6c 69 73 74 20 6f 66 |value is| list of|
|00000ac0| 20 73 74 72 69 6e 67 73 | 2c 20 6f 6e 65 20 66 6f | strings|, one fo|
|00000ad0| 72 20 65 61 63 68 20 6c | 69 6e 65 20 6f 66 20 74 |r each l|ine of t|
|00000ae0| 68 65 20 72 65 63 74 61 | 6e 67 6c 65 2e 22 5d 29 |he recta|ngle."])|
|00000af0| 0a 28 66 73 65 74 20 27 | 65 78 74 72 61 63 74 2d |.(fset '|extract-|
|00000b00| 72 65 63 74 61 6e 67 6c | 65 20 23 5b 28 73 74 61 |rectangl|e #[(sta|
|00000b10| 72 74 20 65 6e 64 29 20 | 22 c0 43 19 c2 c3 0c 0d |rt end) |".C.....|
|00000b20| c0 09 25 88 09 41 9f 29 | 87 22 20 5b 6e 69 6c 20 |..%..A.)|." [nil |
|00000b30| 6c 69 6e 65 73 20 6f 70 | 65 72 61 74 65 2d 6f 6e |lines op|erate-on|
|00000b40| 2d 72 65 63 74 61 6e 67 | 6c 65 20 65 78 74 72 61 |-rectang|le extra|
|00000b50| 63 74 2d 72 65 63 74 61 | 6e 67 6c 65 2d 6c 69 6e |ct-recta|ngle-lin|
|00000b60| 65 20 73 74 61 72 74 20 | 65 6e 64 5d 20 36 20 22 |e start |end] 6 "|
|00000b70| 5c 0a 52 65 74 75 72 6e | 20 63 6f 6e 74 65 6e 74 |\.Return| content|
|00000b80| 73 20 6f 66 20 72 65 63 | 74 61 6e 67 6c 65 20 77 |s of rec|tangle w|
|00000b90| 69 74 68 20 63 6f 72 6e | 65 72 73 20 61 74 20 53 |ith corn|ers at S|
|00000ba0| 54 41 52 54 20 61 6e 64 | 20 45 4e 44 2e 0a 56 61 |TART and| END..Va|
|00000bb0| 6c 75 65 20 69 73 20 6c | 69 73 74 20 6f 66 20 73 |lue is l|ist of s|
|00000bc0| 74 72 69 6e 67 73 2c 20 | 6f 6e 65 20 66 6f 72 20 |trings, |one for |
|00000bd0| 65 61 63 68 20 6c 69 6e | 65 20 6f 66 20 74 68 65 |each lin|e of the|
|00000be0| 20 72 65 63 74 61 6e 67 | 6c 65 2e 22 5d 29 0a 28 | rectang|le."]).(|
|00000bf0| 64 65 66 76 61 72 20 6b | 69 6c 6c 65 64 2d 72 65 |defvar k|illed-re|
|00000c00| 63 74 61 6e 67 6c 65 20 | 6e 69 6c 20 22 5c 0a 52 |ctangle |nil "\.R|
|00000c10| 65 63 74 61 6e 67 6c 65 | 20 66 6f 72 20 79 61 6e |ectangle| for yan|
|00000c20| 6b 2d 72 65 63 74 61 6e | 67 6c 65 20 74 6f 20 69 |k-rectan|gle to i|
|00000c30| 6e 73 65 72 74 2e 22 29 | 0a 28 66 73 65 74 20 27 |nsert.")|.(fset '|
|00000c40| 6b 69 6c 6c 2d 72 65 63 | 74 61 6e 67 6c 65 20 23 |kill-rec|tangle #|
|00000c50| 5b 28 73 74 61 72 74 20 | 65 6e 64 29 20 22 c0 09 |[(start |end) "..|
|00000c60| 5c 6e 5c 22 89 13 87 22 | 20 5b 64 65 6c 65 74 65 |\n\"..."| [delete|
|00000c70| 2d 65 78 74 72 61 63 74 | 2d 72 65 63 74 61 6e 67 |-extract|-rectang|
|00000c80| 6c 65 20 73 74 61 72 74 | 20 65 6e 64 20 6b 69 6c |le start| end kil|
|00000c90| 6c 65 64 2d 72 65 63 74 | 61 6e 67 6c 65 5d 20 33 |led-rect|angle] 3|
|00000ca0| 20 22 5c 0a 44 65 6c 65 | 74 65 20 72 65 63 74 61 | "\.Dele|te recta|
|00000cb0| 6e 67 6c 65 20 77 69 74 | 68 20 63 6f 72 6e 65 72 |ngle wit|h corner|
|00000cc0| 73 20 61 74 20 70 6f 69 | 6e 74 20 61 6e 64 20 6d |s at poi|nt and m|
|00000cd0| 61 72 6b 3b 20 73 61 76 | 65 20 61 73 20 6c 61 73 |ark; sav|e as las|
|00000ce0| 74 20 6b 69 6c 6c 65 64 | 20 6f 6e 65 2e 0a 43 61 |t killed| one..Ca|
|00000cf0| 6c 6c 69 6e 67 20 66 72 | 6f 6d 20 70 72 6f 67 72 |lling fr|om progr|
|00000d00| 61 6d 2c 20 73 75 70 70 | 6c 79 20 74 77 6f 20 61 |am, supp|ly two a|
|00000d10| 72 67 73 20 53 54 41 52 | 54 20 61 6e 64 20 45 4e |rgs STAR|T and EN|
|00000d20| 44 2c 20 62 75 66 66 65 | 72 20 70 6f 73 69 74 69 |D, buffe|r positi|
|00000d30| 6f 6e 73 2e 0a 42 75 74 | 20 69 6e 20 70 72 6f 67 |ons..But| in prog|
|00000d40| 72 61 6d 73 20 79 6f 75 | 20 6d 69 67 68 74 20 70 |rams you| might p|
|00000d50| 72 65 66 65 72 20 74 6f | 20 75 73 65 20 60 64 65 |refer to| use `de|
|00000d60| 6c 65 74 65 2d 65 78 74 | 72 61 63 74 2d 72 65 63 |lete-ext|ract-rec|
|00000d70| 74 61 6e 67 6c 65 27 2e | 22 20 22 72 22 5d 29 0a |tangle'.|" "r"]).|
|00000d80| 28 66 73 65 74 20 27 79 | 61 6e 6b 2d 72 65 63 74 |(fset 'y|ank-rect|
|00000d90| 61 6e 67 6c 65 20 23 5b | 6e 69 6c 20 22 c0 09 21 |angle #[|nil "..!|
|00000da0| 87 22 20 5b 69 6e 73 65 | 72 74 2d 72 65 63 74 61 |." [inse|rt-recta|
|00000db0| 6e 67 6c 65 20 6b 69 6c | 6c 65 64 2d 72 65 63 74 |ngle kil|led-rect|
|00000dc0| 61 6e 67 6c 65 5d 20 32 | 20 22 5c 0a 59 61 6e 6b |angle] 2| "\.Yank|
|00000dd0| 20 74 68 65 20 6c 61 73 | 74 20 6b 69 6c 6c 65 64 | the las|t killed|
|00000de0| 20 72 65 63 74 61 6e 67 | 6c 65 20 77 69 74 68 20 | rectang|le with |
|00000df0| 75 70 70 65 72 20 6c 65 | 66 74 20 63 6f 72 6e 65 |upper le|ft corne|
|00000e00| 72 20 61 74 20 70 6f 69 | 6e 74 2e 22 20 6e 69 6c |r at poi|nt." nil|
|00000e10| 5d 29 0a 28 66 73 65 74 | 20 27 69 6e 73 65 72 74 |]).(fset| 'insert|
|00000e20| 2d 72 65 63 74 61 6e 67 | 6c 65 20 23 5b 28 72 65 |-rectang|le #[(re|
|00000e30| 63 74 61 6e 67 6c 65 29 | 20 22 08 69 c1 1a 1b 1c |ctangle)| ".i....|
|00000e40| c5 20 88 0c ad 9e 5c 6e | ac 8e c6 79 88 6e ac 83 |. ....\n|...y.n..|
|00000e50| c7 63 88 c8 0b c1 5c 22 | 88 c9 12 0c 40 63 88 0c |.c....\"|....@c..|
|00000e60| 41 89 14 ac 63 c9 2b 87 | 22 20 5b 72 65 63 74 61 |A...c.+.|" [recta|
|00000e70| 6e 67 6c 65 20 74 20 66 | 69 72 73 74 20 69 6e 73 |ngle t f|irst ins|
|00000e80| 65 72 74 63 6f 6c 75 6d | 6e 20 6c 69 6e 65 73 20 |ertcolum|n lines |
|00000e90| 70 75 73 68 2d 6d 61 72 | 6b 20 31 20 31 30 20 6d |push-mar|k 1 10 m|
|00000ea0| 6f 76 65 2d 74 6f 2d 63 | 6f 6c 75 6d 6e 20 6e 69 |ove-to-c|olumn ni|
|00000eb0| 6c 5d 20 34 20 22 5c 0a | 49 6e 73 65 72 74 20 74 |l] 4 "\.|Insert t|
|00000ec0| 65 78 74 20 6f 66 20 52 | 45 43 54 41 4e 47 4c 45 |ext of R|ECTANGLE|
|00000ed0| 20 77 69 74 68 20 75 70 | 70 65 72 20 6c 65 66 74 | with up|per left|
|00000ee0| 20 63 6f 72 6e 65 72 20 | 61 74 20 70 6f 69 6e 74 | corner |at point|
|00000ef0| 2e 0a 52 45 43 54 41 4e | 47 4c 45 27 73 20 66 69 |..RECTAN|GLE's fi|
|00000f00| 72 73 74 20 6c 69 6e 65 | 20 69 73 20 69 6e 73 65 |rst line| is inse|
|00000f10| 72 74 65 64 20 61 74 20 | 70 6f 69 6e 74 2c 0a 69 |rted at |point,.i|
|00000f20| 74 73 20 73 65 63 6f 6e | 64 20 6c 69 6e 65 20 69 |ts secon|d line i|
|00000f30| 73 20 69 6e 73 65 72 74 | 65 64 20 61 74 20 61 20 |s insert|ed at a |
|00000f40| 70 6f 69 6e 74 20 76 65 | 72 74 69 63 61 6c 6c 79 |point ve|rtically|
|00000f50| 20 75 6e 64 65 72 20 70 | 6f 69 6e 74 2c 20 65 74 | under p|oint, et|
|00000f60| 63 2e 0a 52 45 43 54 41 | 4e 47 4c 45 20 73 68 6f |c..RECTA|NGLE sho|
|00000f70| 75 6c 64 20 62 65 20 61 | 20 6c 69 73 74 20 6f 66 |uld be a| list of|
|00000f80| 20 73 74 72 69 6e 67 73 | 2e 0a 41 66 74 65 72 20 | strings|..After |
|00000f90| 74 68 69 73 20 63 6f 6d | 6d 61 6e 64 2c 20 74 68 |this com|mand, th|
|00000fa0| 65 20 6d 61 72 6b 20 69 | 73 20 61 74 20 74 68 65 |e mark i|s at the|
|00000fb0| 20 75 70 70 65 72 20 6c | 65 66 74 20 63 6f 72 6e | upper l|eft corn|
|00000fc0| 65 72 0a 61 6e 64 20 70 | 6f 69 6e 74 20 69 73 20 |er.and p|oint is |
|00000fd0| 61 74 20 74 68 65 20 6c | 6f 77 65 72 20 72 69 67 |at the l|ower rig|
|00000fe0| 68 74 20 63 6f 72 6e 65 | 72 2e 22 5d 29 0a 28 66 |ht corne|r."]).(f|
|00000ff0| 73 65 74 20 27 6f 70 65 | 6e 2d 72 65 63 74 61 6e |set 'ope|n-rectan|
|00001000| 67 6c 65 20 23 5b 28 73 | 74 61 72 74 20 65 6e 64 |gle #[(s|tart end|
|00001010| 29 20 22 c0 c1 5c 6e 0b | c4 24 88 5c 6e 62 87 22 |) "..\n.|.$.\nb."|
|00001020| 20 5b 6f 70 65 72 61 74 | 65 2d 6f 6e 2d 72 65 63 | [operat|e-on-rec|
|00001030| 74 61 6e 67 6c 65 20 6f | 70 65 6e 2d 72 65 63 74 |tangle o|pen-rect|
|00001040| 61 6e 67 6c 65 2d 6c 69 | 6e 65 20 73 74 61 72 74 |angle-li|ne start|
|00001050| 20 65 6e 64 20 6e 69 6c | 5d 20 35 20 22 5c 0a 42 | end nil|] 5 "\.B|
|00001060| 6c 61 6e 6b 20 6f 75 74 | 20 72 65 63 74 61 6e 67 |lank out| rectang|
|00001070| 6c 65 20 77 69 74 68 20 | 63 6f 72 6e 65 72 73 20 |le with |corners |
|00001080| 61 74 20 70 6f 69 6e 74 | 20 61 6e 64 20 6d 61 72 |at point| and mar|
|00001090| 6b 2c 20 73 68 69 66 74 | 69 6e 67 20 74 65 78 74 |k, shift|ing text|
|000010a0| 20 72 69 67 68 74 2e 0a | 54 68 65 20 74 65 78 74 | right..|The text|
|000010b0| 20 70 72 65 76 69 6f 75 | 73 6c 79 20 69 6e 20 74 | previou|sly in t|
|000010c0| 68 65 20 72 65 67 69 6f | 6e 20 69 73 20 6e 6f 74 |he regio|n is not|
|000010d0| 20 6f 76 65 72 77 72 69 | 74 74 65 6e 20 62 79 20 | overwri|tten by |
|000010e0| 74 68 65 20 62 6c 61 6e | 6b 73 2c 0a 62 75 74 20 |the blan|ks,.but |
|000010f0| 69 6e 73 74 65 61 64 20 | 77 69 6e 64 73 20 75 70 |instead |winds up|
|00001100| 20 74 6f 20 74 68 65 20 | 72 69 67 68 74 20 6f 66 | to the |right of|
|00001110| 20 74 68 65 20 72 65 63 | 74 61 6e 67 6c 65 2e 22 | the rec|tangle."|
|00001120| 20 22 72 22 5d 29 0a 28 | 66 73 65 74 20 27 6f 70 | "r"]).(|fset 'op|
|00001130| 65 6e 2d 72 65 63 74 61 | 6e 67 6c 65 2d 6c 69 6e |en-recta|ngle-lin|
|00001140| 65 20 23 5b 28 73 74 61 | 72 74 70 6f 73 20 62 65 |e #[(sta|rtpos be|
|00001150| 67 65 78 74 72 61 20 65 | 6e 64 65 78 74 72 61 29 |gextra e|ndextra)|
|00001160| 20 22 69 08 5c 5c c1 1a | 1b 0c 62 88 69 0d 5a 1e | "i.\\..|..b.i.Z.|
|00001170| 06 c7 c1 77 88 69 0e 06 | 5a 12 29 0c 60 7c 88 0b |...w.i..|Z.).`|..|
|00001180| 5c 6e 5c 5c 6a 2a 87 22 | 20 5b 65 6e 64 65 78 74 |\n\\j*."| [endext|
|00001190| 72 61 20 6e 69 6c 20 77 | 68 69 74 65 77 69 64 74 |ra nil w|hitewidt|
|000011a0| 68 20 65 6e 64 63 6f 6c | 20 73 74 61 72 74 70 6f |h endcol| startpo|
|000011b0| 73 20 62 65 67 65 78 74 | 72 61 20 62 65 67 63 6f |s begext|ra begco|
|000011c0| 6c 20 22 20 09 22 5d 20 | 32 5d 29 0a 28 66 73 65 |l " ."] |2]).(fse|
|000011d0| 74 20 27 73 74 72 69 6e | 67 2d 72 65 63 74 61 6e |t 'strin|g-rectan|
|000011e0| 67 6c 65 20 23 5b 28 73 | 74 61 72 74 20 65 6e 64 |gle #[(s|tart end|
|000011f0| 20 73 74 72 69 6e 67 29 | 20 22 c0 c1 5c 6e 0b c4 | string)| "..\n..|
|00001200| 0d 25 88 5c 6e 62 87 22 | 20 5b 6f 70 65 72 61 74 |.%.\nb."| [operat|
|00001210| 65 2d 6f 6e 2d 72 65 63 | 74 61 6e 67 6c 65 20 73 |e-on-rec|tangle s|
|00001220| 74 72 69 6e 67 2d 72 65 | 63 74 61 6e 67 6c 65 2d |tring-re|ctangle-|
|00001230| 6c 69 6e 65 20 73 74 61 | 72 74 20 65 6e 64 20 74 |line sta|rt end t|
|00001240| 20 73 74 72 69 6e 67 5d | 20 36 20 22 5c 0a 49 6e | string]| 6 "\.In|
|00001250| 73 65 72 74 20 53 54 52 | 49 4e 47 20 6f 6e 20 65 |sert STR|ING on e|
|00001260| 61 63 68 20 6c 69 6e 65 | 20 6f 66 20 74 68 65 20 |ach line| of the |
|00001270| 72 65 67 69 6f 6e 2d 72 | 65 63 74 61 6e 67 6c 65 |region-r|ectangle|
|00001280| 2c 20 73 68 69 66 74 69 | 6e 67 20 74 65 78 74 20 |, shifti|ng text |
|00001290| 72 69 67 68 74 2e 0a 54 | 68 65 20 6c 65 66 74 20 |right..T|he left |
|000012a0| 65 64 67 65 20 6f 66 20 | 74 68 65 20 72 65 63 74 |edge of |the rect|
|000012b0| 61 6e 67 6c 65 20 73 70 | 65 63 69 66 69 65 73 20 |angle sp|ecifies |
|000012c0| 74 68 65 20 63 6f 6c 75 | 6d 6e 20 66 6f 72 20 69 |the colu|mn for i|
|000012d0| 6e 73 65 72 74 69 6f 6e | 2e 0a 54 68 69 73 20 63 |nsertion|..This c|
|000012e0| 6f 6d 6d 61 6e 64 20 64 | 6f 65 73 20 6e 6f 74 20 |ommand d|oes not |
|000012f0| 64 65 6c 65 74 65 20 6f | 72 20 6f 76 65 72 77 72 |delete o|r overwr|
|00001300| 69 74 65 20 61 6e 79 20 | 65 78 69 73 74 69 6e 67 |ite any |existing|
|00001310| 20 74 65 78 74 2e 0a 0a | 43 61 6c 6c 65 64 20 66 | text...|Called f|
|00001320| 72 6f 6d 20 61 20 70 72 | 6f 67 72 61 6d 2c 20 74 |rom a pr|ogram, t|
|00001330| 61 6b 65 73 20 74 68 72 | 65 65 20 61 72 67 73 3b |akes thr|ee args;|
|00001340| 20 53 54 41 52 54 2c 20 | 45 4e 44 20 61 6e 64 20 | START, |END and |
|00001350| 53 54 52 49 4e 47 2e 22 | 20 22 72 5c 6e 73 53 74 |STRING."| "r\nsSt|
|00001360| 72 69 6e 67 20 72 65 63 | 74 61 6e 67 6c 65 3a 20 |ring rec|tangle: |
|00001370| 22 5d 29 0a 28 66 73 65 | 74 20 27 73 74 72 69 6e |"]).(fse|t 'strin|
|00001380| 67 2d 72 65 63 74 61 6e | 67 6c 65 2d 6c 69 6e 65 |g-rectan|gle-line|
|00001390| 20 23 5b 28 73 74 61 72 | 74 70 6f 73 20 62 65 67 | #[(star|tpos beg|
|000013a0| 65 78 74 72 61 20 65 6e | 64 65 78 74 72 61 20 73 |extra en|dextra s|
|000013b0| 74 72 69 6e 67 29 20 22 | c0 19 5c 6e 62 88 69 1b |tring) "|..\nb.i.|
|000013c0| c4 c0 77 88 69 0b 5a 11 | 29 5c 6e 60 7c 88 0d 63 |..w.i.Z.|)\n`|..c|
|000013d0| 88 69 09 5c 5c 6a 29 87 | 22 20 5b 6e 69 6c 20 77 |.i.\\j).|" [nil w|
|000013e0| 68 69 74 65 73 70 61 63 | 65 20 73 74 61 72 74 70 |hitespac|e startp|
|000013f0| 6f 73 20 6f 63 6f 6c 20 | 22 20 09 22 20 73 74 72 |os ocol |" ." str|
|00001400| 69 6e 67 5d 20 32 5d 29 | 0a 28 66 73 65 74 20 27 |ing] 2])|.(fset '|
|00001410| 63 6c 65 61 72 2d 72 65 | 63 74 61 6e 67 6c 65 20 |clear-re|ctangle |
|00001420| 23 5b 28 73 74 61 72 74 | 20 65 6e 64 29 20 22 c0 |#[(start| end) ".|
|00001430| c1 5c 6e 0b c4 24 87 22 | 20 5b 6f 70 65 72 61 74 |.\n..$."| [operat|
|00001440| 65 2d 6f 6e 2d 72 65 63 | 74 61 6e 67 6c 65 20 63 |e-on-rec|tangle c|
|00001450| 6c 65 61 72 2d 72 65 63 | 74 61 6e 67 6c 65 2d 6c |lear-rec|tangle-l|
|00001460| 69 6e 65 20 73 74 61 72 | 74 20 65 6e 64 20 74 5d |ine star|t end t]|
|00001470| 20 35 20 22 5c 0a 42 6c | 61 6e 6b 20 6f 75 74 20 | 5 "\.Bl|ank out |
|00001480| 72 65 63 74 61 6e 67 6c | 65 20 77 69 74 68 20 63 |rectangl|e with c|
|00001490| 6f 72 6e 65 72 73 20 61 | 74 20 70 6f 69 6e 74 20 |orners a|t point |
|000014a0| 61 6e 64 20 6d 61 72 6b | 2e 0a 54 68 65 20 74 65 |and mark|..The te|
|000014b0| 78 74 20 70 72 65 76 69 | 6f 75 73 6c 79 20 69 6e |xt previ|ously in|
|000014c0| 20 74 68 65 20 72 65 67 | 69 6f 6e 20 69 73 20 6f | the reg|ion is o|
|000014d0| 76 65 72 77 72 69 74 74 | 65 6e 20 62 79 20 74 68 |verwritt|en by th|
|000014e0| 65 20 62 6c 61 6e 6b 73 | 2e 0a 57 68 65 6e 20 63 |e blanks|..When c|
|000014f0| 61 6c 6c 65 64 20 66 72 | 6f 6d 20 61 20 70 72 6f |alled fr|om a pro|
|00001500| 67 72 61 6d 2c 20 72 65 | 71 75 69 72 65 73 20 74 |gram, re|quires t|
|00001510| 77 6f 20 61 72 67 73 20 | 77 68 69 63 68 20 73 70 |wo args |which sp|
|00001520| 65 63 69 66 79 20 74 68 | 65 20 63 6f 72 6e 65 72 |ecify th|e corner|
|00001530| 73 2e 22 20 22 72 22 5d | 29 0a 28 62 79 74 65 2d |s." "r"]|).(byte-|
|00001540| 63 6f 64 65 20 22 c0 c1 | 4d 88 c2 c3 21 87 22 20 |code "..|M...!." |
|00001550| 5b 63 6c 65 61 72 2d 72 | 65 63 74 61 6e 67 6c 65 |[clear-r|ectangle|
|00001560| 2d 6c 69 6e 65 20 23 5b | 28 73 74 61 72 74 70 6f |-line #[|(startpo|
|00001570| 73 20 62 65 67 65 78 74 | 72 61 20 65 6e 64 65 78 |s begext|ra endex|
|00001580| 74 72 61 29 20 22 c0 c1 | 77 88 69 5c 6e 5c 5c 1b |tra) "..|w.i\n\\.|
|00001590| 60 0c 62 88 c0 c1 78 88 | 60 7c 88 0b 6a 29 87 22 |`.b...x.|`|..j)."|
|000015a0| 20 5b 22 20 09 22 20 6e | 69 6c 20 65 6e 64 65 78 | [" ." n|il endex|
|000015b0| 74 72 61 20 63 6f 6c 75 | 6d 6e 20 73 74 61 72 74 |tra colu|mn start|
|000015c0| 70 6f 73 5d 20 33 5d 20 | 70 72 6f 76 69 64 65 20 |pos] 3] |provide |
|000015d0| 72 65 63 74 5d 20 32 29 | 0a |rect] 2)|. |
+--------+-------------------------+-------------------------+--------+--------+